# Maintainer: Dave Reisner <d@falconindy.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Andrej Gelenberg <andrej.gelenberg@udo.edu>

pkgname=yajl
pkgver=2.0.4
pkgrel=1.1
pkgdesc='Yet Another JSON Library.'
arch=('i686' 'x86_64' 'sh4')
url='http://lloyd.github.com/yajl/'
license=('ISC')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::https://github.com/lloyd/$pkgname/tarball/$pkgver")
md5sums=('ee6208e697c43dcccf798ce80d370379')

build() {
  dirname=$(tar tf "$srcdir/$pkgname-$pkgver.tar.gz" | sed 1q);
  cd "$dirname"

  cmake -DCMAKE_INSTALL_PREFIX=/usr .

  make
}

package() {
  dirname=$(tar tf "$srcdir/$pkgname-$pkgver.tar.gz" | sed 1q);
  cd "$dirname"

  make DESTDIR="$pkgdir" install

  install -Dm644 COPYING "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}
